---
title: "Get Agent Activity"
api: "GET https://api-v2.opencopilot.so/backend/reports/{orgId}/agents/activity"
description: "Retrieve activity data for agents, including their active and open sessions within a specified time range."
---

This endpoint provides insights into agent activity, showing the number of active sessions and open sessions for each agent. It helps in monitoring agent workload and performance.

### Path Parameters

<ParamField path="orgId" type="string" required>
  The unique identifier of the organization.
</ParamField>

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

### Query Parameters

<ParamField query="startDate" type="string" format="date-time" optional>
  The start date for the report period (ISO 8601 format).
</ParamField>

<ParamField query="endDate" type="string" format="date-time" optional>
  The end date for the report period (ISO 8601 format).
</ParamField>

### Response

<ResponseField name="agent_id" type="number">
  The unique identifier of the agent.
</ResponseField>

<ResponseField name="active_sessions" type="number">
  The total number of active sessions handled by the agent within the specified time range.
</ResponseField>

<ResponseField name="open_sessions" type="number">
  The number of currently open sessions assigned to the agent.
</ResponseField>

### Example Request

```bash
curl --location --request GET 'https://api-v2.opencopilot.so/backend/reports/agents/activity?startDate=2023-01-01T00:00:00Z&endDate=2023-12-31T23:59:59Z' \
--header 'Authorization: Bearer YOUR_API_KEY'
```

### Example Response

```json
[
  {
    "agent_id": 1,
    "active_sessions": 150,
    "open_sessions": 5
  },
  {
    "agent_id": 2,
    "active_sessions": 120,
    "open_sessions": 3
  },
  {
    "agent_id": 3,
    "active_sessions": 180,
    "open_sessions": 7
  }
]
```